package cn.tianyigps.tianyigpsyndistributetask.customer;


import cn.tianyigps.tianyigpskafka.task.customer.NewCustomer;
import cn.tianyigps.tianyigpspublic.param.bo.Task;
import cn.tianyigps.tianyigpsyndistributetask.handler.SubscriberHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;



/**
 * @Author: WEI.YUAN
 * @Descirption:数据分发服务
 * @Date: 2019/4/24_16:49
 */
@Component
@Slf4j
public class DistributeTaskCustomer extends NewCustomer {
    @Autowired
    SubscriberHandler subscriberHandler;

    @Override
    public boolean checkTask(Task task) {
        if(CollectionUtils.isEmpty(task.getParams())){
            return false;
        }
        return true;
    }

    @Override
    public void consume(Task task) {
        subscriberHandler.checkData(task);
    }

}
